<script setup>
import { useRoute } from "vue-router";
import { connect, state } from "./dapp";

import {onresizeLayout} from './common/util'
const route = useRoute();

async function init() {
  try {
    await connect(false);
  } catch (e) {
    console.log("connect err", e);
  }
  state.loaded = true;
}

init();

// alert(document.body.clientWidth + "-" + document.body.clientHeight)
// if (document.body.clientWidth <= 750) {
//   document.getElementsByTagName("html")[0].style.fontSize = "187px";
// }

window.onresize = () => {
  onresizeLayout()
  // if (document.body.clientWidth <= 750) {
  //   document.getElementsByTagName("html")[0].style.fontSize = "187px";
  //   // Util.isMobile = true
  // } else {
  //   // Util.isMobile = false
  // }
};
window.onresize();

</script>

<template>
  <router-view v-if="state.loaded"></router-view>
</template>

<style lang="scss">
html body {
  background-color: #fff;
}

// html body {
//   background-color: #AFAFAF;
// }
#app {
  /*height: 100%;*/
  width: 100%;
  padding: 0 224px;
}
@media screen and (max-width: 750px) {
  #app {
    overflow: hidden;
    padding: 0 20px;
  }
}
</style>
